#include "base.h"

#ifdef USE_API_GFX_SDL_GL

#ifdef UGLY_HACK_FOR_THOSE_WHO_DONT_KNOW_HOWTO_INSTALL_SDL
#include <SDL.h>
#else
#include <SDL/SDL.h>
#endif

//
// Initialization
//

float time_get(void)
{
    return SDL_GetTicks() / 1000.0;
}

void time_sleep(float secs)
{
    SDL_Delay(secs*1000);
    return;
}

void base_init(void)
{
    SDL_Init(SDL_INIT_JOYSTICK);
    SDL_JoystickEventState(SDL_ENABLE);

    // Initialize timer
    time_get();
    return;
}

void base_exit(void)
{
    SDL_Quit();
    return;
}

#endif
